home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
426-450
/
disk_438
/
toollib
/
tool.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
7KB
|
239 lines
/*
* tool.h version 7.6 - © Copyright 1990 Jaba Development
*
* Author : Jan van den Baard
*
* Aztec C v5.0a header
*/
#ifndef TOOL_H
#define TOOL_H
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef EXEC_MEMORY_H
#include <exec/memory.h>
#endif
#ifndef EXEC_PORTS_H
#include <exec/ports.h>
#endif
#ifndef EXEC_IO_H
#include <exec/io.h>
#endif
#ifndef DEVICES_TIMER_H
#include <devices/timer.h>
#endif
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h>
#endif
#ifndef LIBRARIES_DOS_H
#include <libraries/dos.h>
#endif
#ifndef LIBRARIES_DOSEXTENS_H
#include <libraries/dosextens.h>
#endif
#ifndef INTUITION_INTUITION_H
#include <intuition/intuition.h>
#endif
#ifndef INTUITION_INTUITIONBASE_H
#include <intuition/intuitionbase.h>
#endif
struct ToolBase
{
struct Library LibNode;
struct ExecBae *SysBase;
struct DosLibrary *DOSBase;
struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
LONG SegList;
};
#define TOOL_VERSION 7
#define TOOL_REVISION 6
struct TimeDelay
{
struct MsgPort *td_UserPort;
struct MsgPort *td_ReplyPort;
struct timerequest *td_TimeRequest;
};
#define LONGALLIGN(s) (((s)+7)&-8)
/*
* The MemoryBlock, MemoryItem, BlockList and ItemList structures
* are PRIVATE structures used by the memory routines of the library.
* DO NOT SCREW ARROUND WITH THESE STRUCTURES BECAUSE THEY MIGHT CHANGE
* IN FUTURE RELEASES OF THE LIBRARY !!!!!!!!!
*/
struct MemoryBlock
{
struct MemoryBlock *mb_Next;
struct MemoryBlock *mb_Previous;
ULONG mb_Requirements;
ULONG mb_BytesUsed;
};
struct MemoryItem
{
struct MemoryItem *mi_Next;
struct MemoryItem *mi_Previous;
struct MemoryBlock *mi_Block;
ULONG mi_Size;
};
struct BlockList
{
struct MemoryBlock *bl_First;
struct MemoryBlock *bl_End;
struct MemoryBlock *bl_Last;
};
struct ItemList
{
struct MemoryItem *il_First;
struct MemoryItem *il_End;
struct MemoryItem *il_Last;
};
/*
* YOU MAY ONLY USE THIS STRUCTURE TO PASS TO THE MEMORY ROUTINES OF
* THE LIBRARY. DO NOT CHANGE THE CONTENTS OF A MEMORYCHAIN STRUCTURE
* IN YOUR PROGRAMS BECAUSE THIS STRUCTURE MAY CHANGE IN FUTURE RELEASES
* OF THE LIBRARY !!!!!!!!!
*/
struct MemoryChain
{
struct BlockList mc_Blocks;
struct ItemList mc_Items;
ULONG mc_BlockSize;
};
#define MINDATE 32
#define ALL 0
#define ONLY_DAY 1
#define ONLY_DATE 2
#define ONLY_TIME 3
#define NO_CASE 0
#define CASE 1
#define ENTRY_FILE 0
#define ENTRY_DIR 1
#define ENTRY_DEV 2
#define DIRBLOCK (5 * 1024)
struct EntryInfo
{
struct EntryInfo *ei_Next;
struct EntryInfo *ei_Previous;
USHORT ei_Type;
UBYTE ei_Name[32];
LONG ei_SizeBytes;
LONG ei_SizeBlocks;
LONG ei_ProtectionBits;
struct DateStamp ei_Date;
};
struct Directory
{
struct EntryInfo *dr_First;
struct EntryInfo *dr_End;
struct EntryInfo *dr_Last;
struct FileInfoBlock *dr_InfoBlock;
BPTR dr_Lock;
ULONG dr_NumEntries;
struct MemoryChain dr_DirMem;
};
#define FREQ_OK 0
#define FREQ_CANT_OPEN 1
#define FREQ_FILE_ERROR 2
#define FREQ_CANCELED 3
struct FileRequester
{
char *fr_HeadLine;
char *fr_FileName;
char *fr_DirName;
char *fr_DontShow;
USHORT fr_LeftEdge;
USHORT fr_TopEdge;
struct Window *fr_Caller;
struct Screen *fr_Screen;
struct Directory *fr_Directory;
USHORT fr_Flags;
USHORT fr_Colors[4];
BPTR fr_Handle;
LONG fr_Reserved;
};
#define FREQ_WIDTH 260
#define FREQ_HEIGHT 140
#define FR_NoPreserve 1
#define FR_NoDevs 2
#define FR_NoSort 4
#define FR_CustColor 8
#define FR_ReturnOld 16
#define FR_ReturnNew 32
#define FR_ReturnReadWrite 64
#define FR_ReturnVoid 0
#ifndef __FUNCTIONS_H
struct MsgPort *CreatePort(char *name, long pri);
void DeletePort(struct MsgPort *port);
struct IORequest *CreateExtIO(struct MsgPort *port, long size);
void DeleteExtIO(struct IORequest *req);
struct IOStdReq *CreateStdIO(struct MsgPort *port);
void DeleteStdIO(struct IOStdReq *req);
#endif
struct TimeDelay *CreateTimeDelay(struct MsgPort *port, long se, long mi);
long DoTimeDelay(struct TimeDelay *dt);
void DeleteTimeDelay(struct TimeDelay *dl);
void QuickSort(char *base, long num, long size, long (*compa)());
void SwapMem(char *mema, char *memb, long size);
long TestBits(long value, long bits);
void SelectGadget(struct Window *w, struct Gadget *g, struct Requester *r);
void DeSelectGadget(struct Window *w, struct Gadget *g, struct Requester *r);
void MutualExclude(struct Window *w, struct Gadget *g, struct Gadget *f, struct Requester *r);
void MutualInclude(struct Window *w, struct Gadget *g, struct Gadget *f, struct Requester *r);
void EraseGadget(struct Window *w, struct Gadget *g, struct Requester *r);
void GadgetOn(struct Window *w, struct Gadget *g, struct Requester *r);
void GadgetOff(struct Window *w, struct Gadget *g, struct Requester *r);
long SelectTest(struct Gadget *g);
void ShadowGadget(struct Window *w, struct Gadget *g, struct Requester *r, long col);
void OnGList(struct Window *w, struct Gadget *g, struct Requester *r, long n);
void OffGList(struct Window *w, struct Gadget *g, struct Requester *r, long n);
void SelectGList(struct Window *w, struct Gadget *g, struct Requester *r, long n);
void DeSelectGList(struct Window *w, struct Gadget *g, struct Requester *r, long n);
void ShadowGList(struct Window *w, struct Gadget *g, struct Requester *r, long n, long c);
void EraseGList(struct Window *w, struct Gadget *g, struct Requester *r, long n);
void InitMemoryChain(struct MemoryChain *mchain, long size);
void *AllocItem(struct MemoryChain *mchain, long size, long reqs);
void FreeItem(struct MemoryChain *mchain, void *memptr, long size);
void FreeMemoryChain(struct MemoryChain *mchain);
void Format(char *buffer, char *fstring, ...);
long WriteFormat(BPTR file, char *fstring, ...);
long MatchPattern(char *string, char *pattern, long cse);
long Isolate(char *pathname, char *buffer);
void BstrToCstr(BPTR *bstr, char *buffer);
long GetDate(struct DateStamp *date, char *buffer, long how);
long OpenDir(struct Directory *dir, char *name);
struct EntryInfo *GetEntry(struct Directory *dir);
void CloseDir(struct Directory *dir);
void FreeDir(struct Directory *dir);
char *IoErrToStr();
struct FileRequester *AllocFreq();
void FreeFreq(struct FileRequester *freq);
long FileRequest(struct FileRequester *freq);
#ifndef __NO_PRAGMAS
#include <tool_pragmas.h>
#endif
#endif